﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="exceptType.aspx.cs"
    Inherits="WorkOrder.exceptType" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../css/left.css" type="text/css" rel="STYLESHEET" />
    <link href="../css/site2.css" type="text/css" rel="STYLESHEET" />
    <link rel="stylesheet" type="text/css" href="../css/subModal.css" />
    <script type="text/javascript" src="../js/common.js" defer="defer"></script>
    <script type="text/javascript" src="../js/subModal.js" defer="defer"></script>
    <script type="text/javascript" src="../js/cookie.js" defer="defer"></script>
    <script language="javascript" type="text/javascript">        //加在head中，PNG无灰色背景
        var tmp = window.navigator.userAgent.toLowerCase().indexOf("MSIE");
        //加在head中，PNG无灰色背景
        function correctPNG() {
            for (var i = 0; i < document.images.length; i++) {
                var img = document.images[i];
                var imgName = img.src.toUpperCase();
                if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
                    var imgID = (img.id) ? "id='" + img.id + "' " : "";
                    var imgClass = (img.className) ? "class='" + img.className + "' " : "";
                    var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
                    var imgStyle = "display:inline-block;" + img.style.cssText;
                    if (img.align == "left") imgStyle = "float:left;" + imgStyle;
                    if (img.align == "right") imgStyle = "float:right;" + imgStyle;
                    if (tmp >= 1) {
                        if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
                    }
                    else {
                        if (img.parentNode.href) imgStyle = "cursor:hand;" + imgStyle;
                    }
                    var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
       + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
                    img.outerHTML = strNewHTML;

                }
            }
        }

        if (window.addEventListener) {
            window.addEventListener('DOMContentLoaded', correctPNG, false);   //firefox
            window.addEventListener('load', correctPNG, false);
        } else if (window.attachEvent) {
            window.attachEvent('onload', correctPNG);  //IE
        }
    </script>
    <script language="javascript" type="text/javascript">
        function EditTable() {
            var tmp = document.getElementById("gvReport");
            if (tmp != null) {
                if (window.returnValue == "OK") {
                    var i = getFramesIndex("hidExceptType");
                    if (i >= 0) {
                        if (window.frames[i].document.getElementById("hidExceptType").value != "") {
                            tmp.rows(rIndex).cells(2).innerText = window.frames[i].document.getElementById("hidExceptType").value;
                            tmp.rows(rIndex).cells(3).innerText = window.frames[i].document.getElementById("hidRemark").value;
                            if (tmp.rows(rIndex).cells(2).innerText == "undefined") tmp.rows(rIndex).cells(2).innerText = "";
                            if (tmp.rows(rIndex).cells(3).innerText == "undefined") tmp.rows(rIndex).cells(3).innerText = "";
                        }
                        else {
                            document.getElementById("btnSearch").click();
                        }
                    }
                }
            }
        }

        function ShowPopup(alable, url) {
            rowIndex(alable.parentElement.parentElement.rowIndex);
            showPopWin('工单问题类型', url, 500, 170, EditTable, true);
        }
    </script>
</head>
<body style="margin: 0 0 0 0; background-color: #fff; border-left: solid 1px #54a6e2;">
    <form id="form1" runat="server">
    <div>
        <table width="100%;" style="border: none 0;">
            <tr>
                <td style="height: 2px;">
                </td>
            </tr>
            <tr>
                <td style="border: solid 1px #9fd6ff; background-image: url('../images/snap3.jpg');
                    height: 24px; color: #0930a5;">
                    &nbsp;&nbsp;<img align="absmiddle" src="../images/doc3.gif" />&nbsp;&nbsp;当前位置：工单问题类型
                </td>
            </tr>
            <tr>
                <td style="height: 1px;">
                </td>
            </tr>
        </table>
        <table width="100%" border="0">
            <tr>
                <td>
                    <div style="border: solid 1px #9fd6ff; background-color: #f0f8ff">
                        <table style="width: 100%">
                            <tr>
                                <td style="width: 10px;">
                                </td>
                                <td>
                                    <table border="0" style="width: 100%">
                                        <tr>
                                            <td style="width: 85px; height: 24px;" align="left">
                                                名称：
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtExceptType" runat="server" CssClass="TextBox" Width="200px"></asp:TextBox>
                                                &nbsp;&nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="height: 24px;">
                                            </td>
                                            <td style="height: 24px;">
                                                <input id="btnSearch" runat="server" type="button" value="查  询" class="Button" onserverclick="btnSearch_ServerClick" />&nbsp;&nbsp;&nbsp;&nbsp;
                                                <img align="absmiddle" src="../images/drop-add.gif" /><a href="#" onclick="ShowPopup(this,'addExceptType.aspx');"><span
                                                    style="border: 1px; border-bottom: solid 1px #008000">新增工单问题类型信息</span></a>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <table style="width: 100%">
                            <tr>
                                <td>
                                    <div style="border: solid 1px #9fd6ff; background-color: #d4f1f9; border-bottom: none;">
                                        <table style="width: 100%">
                                            <tr>
                                                <td style="height: 20px;">
                                                    &nbsp;&nbsp;<img alt="" align="absmiddle" src="../images/181.gif" />&nbsp; <strong>查询结果</strong>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <div style="border: solid 1px #9fd6ff; background-color: #f0f8ff;">
                                        <table width="100%">
                                            <tr>
                                                <td style="width: 10px;">
                                                </td>
                                                <td>
                                                    <asp:GridView ID="GridView1" runat="server" CssClass="Table" AutoGenerateColumns="False"
                                                        EmptyDataText="[没有操作记录]" OnRowDataBound="gvReport_RowDataBound" OnRowCommand="gvReport_RowCommand">
                                                        <HeaderStyle CssClass="gridtitle"></HeaderStyle>
                                                        <Columns>
                                                            <asp:TemplateField>
                                                                <ItemStyle HorizontalAlign="Center" Width="35px" />
                                                                <ItemTemplate>
                                                                    <a href="#" onclick="ShowPopup(this,'addExceptType.aspx?a=1&b=<%# Eval("exception_type_id") %>');">
                                                                        &nbsp;&nbsp;<img align="absmiddle" src="../images/note.gif" style="width: 16px; height: 16px;
                                                                            border: none" title="编辑" />&nbsp;&nbsp; </a>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField>
                                                                <ItemStyle HorizontalAlign="Center" Width="35px" />
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="lbtnDel" runat="server" OnClientClick="return confirm('您真的要删除一行数据吗？')"
                                                                        CommandName="Del" CommandArgument='<%# Eval("exception_type_id") %>' ToolTip="删除">
                                                                        &nbsp;&nbsp;<img align="absmiddle" src="../images/note_delete.gif" style="width:16px; height:16px; border:none" title="删除" />&nbsp;&nbsp;
                                                                    </asp:LinkButton>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:BoundField DataField="exception_type" HeaderText="名称" SortExpression="exception_type">
                                                                <ItemStyle Width="250px"></ItemStyle>
                                                            </asp:BoundField>
                                                            <asp:BoundField DataField="remark" HeaderText="备注"></asp:BoundField>
                                                        </Columns>
                                                    </asp:GridView>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
